<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>007.qq.com验证</title>
</head>
<body>
	<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
	
	<input type="text" name="phone" id="phone">
	<button id="rbt007">验证</button>
	
	<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
	<script type="text/javascript">

	var isPhone = /^1[3456789]\d{9}$/;

	$('#rbt007').on('click',function(){

		if(!isPhone.test($('#phone').val())){
            alert('请输入正确的手机号！')
            return false;
        }else{

        	// 直接生成一个验证码对象
			var captcha1 = new TencentCaptcha('20047498755', function(res) {
				console.log(res);
			});
			captcha1.show(); // 显示验证码

        }
	})

	</script>
</body>
</html>